package cn.tedu;

public class Test_02 {
    public static void main(String[] args) {
      //  method();
        method2();
    }

    public static void method() {
        String s = "asddsadsadwdsdwdsffdgffhgh";
        String str="" ;
        long start = System.currentTimeMillis();
        for (int i = 0; i < 10000; i++) {
            str += s;

        }
        long end = System.currentTimeMillis();
        System.out.println(str);
        System.out.println(end - start);


    }

    public static void method2() {
        String s = "asd";
        StringBuilder sb=new StringBuilder();

        long start = System.currentTimeMillis();
        for (int i = 0; i < 10000; i++) {
            sb.append(s);
        }
        long end = System.currentTimeMillis();
        System.out.println(sb);
        System.out.println(end - start);

    }


}
